package com.fbinggun.fbinggunutil.statistics.datatype;

import com.alibaba.fastjson.JSONObject;
import com.fbinggun.fbinggunutil.statistics.StatisticsInfo;

public class IntInfo extends StatisticsInfo<Integer> {


    public IntInfo(String id, Integer integer) {
        super(id, integer);
    }

    public IntInfo(String id, JSONObject jsonObject) {
        super(id, jsonObject);
    }

    @Override
    public StatisticsInfo copy(String id, JSONObject jsonObject) {
        return new IntInfo(id,jsonObject);
    }

    @Override
    public StatisticsInfo copy(String id, Integer integer) {
        return new IntInfo(id,integer);
    }

    @Override
    public void addValue(Integer integer) {
        setValue(integer+getValue());
    }
    @Override
    protected void addSValue(String v) {
        t=Integer.parseInt(v)+t;
    }
    protected void setSValue(String v) {
        t=Integer.parseInt(v);
    }

    @Override
    public String getPlaceholder() {
        return String.valueOf(getValue());
    }


}
